package com.aaa.vegetablemarketexpress.dao;

import com.aaa.vegetablemarketexpress.entity.Variety;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @FileName: Variety
 * @Description:
 * @Author: qxh
 * @CreateTime: 2025/9/8 10:41
 * @Version: 1.0.0
 */
public interface VarietyDao {
    /**
     * 根据VarietyId查询Variety
     * @param varietyId
     * @return
     */
    Variety queryByVarietyId(Long varietyId);
    /**
     * 查询Variety列表/查询品种列表
     * @param variety
     * @return
     */
    List<Variety> queryByParam(Variety variety);
    /**
     * 根据品种名称查询品种
     * @param  varietyName
     * @return
     */
    Variety queryByVarietyName(String varietyName);
    /**
     * 添加 品种
     * @param variety
     * @return
     */
    int insertVariety(Variety variety);
    /**
     * 修改 品种
     * @param variety
     * @return
     */
    int updateVariety(Variety variety);
    /**
     * 删除Variety
     * @param varietyId
     * @return
     */
    int deleteVariety(Long varietyId);
    /**
     * 检查品种是否被使用
     * @param varietyId
     * @return
     */
    int checkVarietyUsed(Long varietyId);
    /**
     * 更新品种状态
     * @param varietyId
     * @return
     */
    int updateVarietyStatus(@Param("varietyId") Long varietyId,
                            @Param("status") String status);
    /**
     * 获取所有正常状态的品种
     * @param
     * @return
     */
    List<Variety> queryAllNormalVariety();

}
